function atkMapDown(event){
	if(mouseObject.isDown)return;
	mouseObject.isDown = true;
	mouseObject.x = event.selfX;
	mouseObject.y = event.selfY;
}
function atkMapUp(event){
	mouseObject.isDown = false;
	if(now_mode == GAME_MODE.SELECTING){
		selectLayer.graphics.clear();
		var sx,sy,w,h;
		if(event.selfX > mouseObject.x){
			sx = mouseObject.x;
			w = event.selfX - mouseObject.x;
		}else{
			sx = event.selfX;
			w = mouseObject.x - event.selfX;
		}
		if(event.selfY > mouseObject.y){
			sy = mouseObject.y;
			h = event.selfY - mouseObject.y;
		}else{
			sy = event.selfY;
			h = mouseObject.y - event.selfY;
		}
		selectCharacters = selfQuery.getDataInRect(new LRectangle(sx,sy,w,h));
		if(selectCharacters.length > 0){
			for (var i = 0; i < selectCharacters.length; i++) {
				var chara = selectCharacters[i];
				chara.mode = "select";
				chara.alpha = 0.5;
			}
		}
		ctrlLayer.buttonClear();
		now_mode = GAME_MODE.SELECTED;
	}else if(now_mode == GAME_MODE.SELECTED){
		if(selectCharacters.length > 0){
			for (var i = 0; i < selectCharacters.length; i++) {
				var chara = selectCharacters[i];
				chara.mode = "move";
				chara.alpha = 1;
				var tx = event.selfX + (Math.random()*100 >>> 0) - 50;
				var ty = event.selfY + (Math.random()*100 >>> 0) - 50;
				chara.to = {x:tx,y:ty};
			}
		}
		now_mode = GAME_MODE.NULL;
	}
}
function atkMapMove(event){
	if(!mouseObject.isDown)return;
	if(now_mode == GAME_MODE.SELECTING){
		drawSelectRect(event);
	}
}